// Update Slate imports to use current types
import { Editor } from 'slate';
import { ReactEditor } from 'slate-react';

declare module 'slate' {
  interface CustomTypes {
    Editor: Editor;
    Element: MedicalElement;
    Text: MedicalText;
  }
}

export type MedicalElementType = 
  'paragraph' | 
  'heading' | 
  'list-item' | 
  'medical-term' |
  'chief-complaint' |
  'present-illness' |
  'past-medical-history' |
  'family-history' |
  'physical-exam' |
  'diagnosis' |
  'treatment-plan' |
  'medication' |
  'laboratory-test' |
  'imaging-study';

export interface FhirDocumentReference {
  resourceType: string;
  content: Array<{
    title: string;
    attachment: {
      data: string;
      creation: string;
    };
    type: {
      coding: Array<{
        code: string;
      }>;
    };
  }>;
}

export interface MedicalElement {
  type: MedicalElementType;
  children: (MedicalElement | MedicalText)[];
  medical?: {
    termId?: string;
    termType?: string;
    updateTime?: string;
    medicalTerm?: boolean;
  };
}

export interface MedicalText {
  text: string;
  bold?: boolean;
  italic?: boolean;
  underlined?: boolean;
  code?: boolean;
  medical?: {
    medicalTerm?: boolean;
    termId?: string;
    termType?: string;
  };
}

export type MedicalDocument = MedicalElement[];